package com.echo.fm.content.news.type;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import com.echo.fm.content.news.type.model.NewsType;
import com.echo.util.ErrorException;

@Service("newsTypeService")
public class DefaultNewsTypeServiceImpl implements INewsTypeService {
	@Autowired
	@Qualifier("newsTypePersistence")
	INewsTypePersistence newsTypePersistence;

	public INewsTypePersistence getNewsTypePersistence() {
		return newsTypePersistence;
	}

	public void setNewsTypePersistence(INewsTypePersistence newsTypePersistence) {
		this.newsTypePersistence = newsTypePersistence;
	}

	public void addNewsType(NewsType newsType) throws ErrorException {

		newsTypePersistence.addNewsType(newsType);
	}

	public List<NewsType> searchNewsTypeList() throws ErrorException {
		return newsTypePersistence.searchNewsTypeList();
	}

	public void updateNewsType(NewsType newsType) throws ErrorException {
		newsTypePersistence.updateNewsType(newsType);

	}

	public void deleteNewsType(NewsType newsType) throws ErrorException {
		newsTypePersistence.deleteNewsType(newsType);

	}

	public NewsType searchNewsTypeId(Integer id) throws ErrorException {

		return newsTypePersistence.searchNewTypeId(id);
	}

}
